home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
10615
/
10615.xpi
/
chrome
/
firedownload.jar
/
content
/
firedownload-overlay.js
< prev
next >
Wrap
Text File
|
2009-05-15
|
1KB
|
39 lines
var FireDownloadOverlay = {
init : function fd_init(e) {
window.addEventListener("unload", FireDownloadOverlay.cleanup, false);
document.getElementById("contentAreaContextMenu").addEventListener("popupshowing", FireDownloadOverlay.popupShowing, false);
},
cleanup : function fd_cleanup(e) {
window.removeEventListener("unload", FireDownloadOverlay.cleanup, false);
window.removeEventListener("load", FireDownloadOverlay.init, false);
document.getElementById("contentAreaContextMenu").removeEventListener("popupshowing", FireDownloadOverlay.popupShowing, false);
},
popupShowing : function fd_popupShowing(e) {
var anchor = document.popupNode;
while (anchor && !(anchor instanceof HTMLAnchorElement)) {
anchor = anchor.parentNode;
}
document.getElementById("firedownload-savelink").hidden = (anchor == null);
},
saveLink : function fd_saveLink()
{
var anchor = document.popupNode;
while (anchor && !(anchor instanceof HTMLAnchorElement)) {
anchor = anchor.parentNode;
}
if (!anchor)
return;
var fireDownload = Cc["@mozilla.org/firedownload;1"].createInstance(Ci.nsIFireDownload);
fireDownload.startDownload(anchor.href, "");
}
};
window.addEventListener("load", FireDownloadOverlay.init, false);